<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <ui:insert name="meta"></ui:insert>
        <title>Orderoid</title>
        <link rel="shortcut icon" href="favicon.ico" />
        <h:outputStylesheet name="css/style.css"/>
        <h:outputStylesheet name="css/menu.css"/>
        <script type="text/javascript" src="resources/scripts/jquery.min.js"></script>
        <script type="text/javascript" src="resources/scripts/ddsmoothmenu.js"></script>
        <script type="text/javascript">

            ddsmoothmenu.init({
                mainmenuid: "main:templatemo_menu", //menu DIV id
                orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
                classname: 'ddsmoothmenu', //class added to menu's outer DIV
                //customtheme: ["#1c5a80", "#18374a"],
                contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
            })

        </script>
    </h:head>

    <h:body>

        <h:panelGroup id="templatemo_wrapper" styleClass="templatemo_wrapper" layout="block">
            <h:form id="form_header">
                <h:panelGroup id="templatemo_header" styleClass="templatemo_header" layout="block">
                    <h:panelGroup styleClass="site_title">
                        <h1><h:commandLink action="/index" value="Orderoid" target="_parent" /></h1>
                    </h:panelGroup>
                    <h:panelGroup id="templatemo_menu" styleClass="ddsmoothmenu" layout="block" rendered="#{sessionScope['user'] != null}">
                        <ul>
                            <li><h:commandLink action="/index" styleClass="selected" value="Accueil" /></li>
                            <li><h:commandLink action="/commande/List" value="Commande" /></li>
                            <li><h:commandLink action="/menu/List" value="Menu" /></li>       
                            <li><h:commandLink action="/produit/List" value="Produit" /></li>
                        </ul>
                    </h:panelGroup> <!-- end of templatemo_menu -->
                    <h:panelGroup styleClass="connexion_tools" rendered="#{sessionScope['user'] != null}">
                        <h:outputText value="Connecté sous : "/>
                        <h:outputText value="#{sessionScope['user'].prenom}"/>
                        <h:outputText value=" " />
                        <h:outputText value="#{sessionScope['user'].nom}"/>
                        <br></br>
                        <h:commandLink styleClass="connexion_tools_deconnexion" value="Déconnexion" action="#{employeController.deconnexion(session)}"/>
                    </h:panelGroup>
                </h:panelGroup> 
            </h:form>
            <!-- end of header -->


            <h:form id="main">

                <!-- Groupe de connexion -->
                <h:panelGroup styleClass="templatemo_main" layout="block" rendered="#{sessionScope['user'] == null}">
                    <h:panelGroup styleClass="templatemo_connexion" layout="block">
                        Identifiant: <br></br>
                        <h:inputText value="#{employeController.selected.login}" maxlength="100" size="12" /> <br></br>

                        Mot de passe: <br></br>
                        <h:inputSecret value="#{employeController.selected.password}" maxlength="255" size="12" /> <br></br>

                        <h:commandButton value="Se connecter" action="#{employeController.connexion(session)}"/>
                    </h:panelGroup>
                </h:panelGroup>
                <br /> <br /> <br />

                <!-- Groupe de travail -->
                <h:panelGroup styleClass="templatemo_main" layout="block" rendered="#{sessionScope['user'] != null}">
                    <h1>
                        <h:panelGroup styleClass="title" layout="block">
                            <ui:insert name="title"></ui:insert>
                        </h:panelGroup>
                    </h1>
                    <h:panelGroup id="messagePanel" layout="block">
                        <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                    </h:panelGroup>
                    <p>
                        <ui:insert name="body"></ui:insert>
                    </p>
                </h:panelGroup>
            </h:form>

        </h:panelGroup>

        <!-- Footer -->
        <h:panelGroup styleClass="templatemo_footer_wrapper" layout="block">
            <h:form id="form_footer">
                <h:panelGroup styleClass="templatemo_footer" layout="block">
                    Copyright © 2012 <h:commandLink action="/index" value="Orderoid"/> | 
                    <h:commandLink action="http://www.mines-ales.fr" value="Ecole des Mines d'Alès" /> par INFRES 3
                </h:panelGroup>
            </h:form>
        </h:panelGroup>
        <!-- End of footer -->

    </h:body>

</html>
